import * as utils from "./utils";

const TEST_USER_URN = "urn:li:corpuser:jdoe";
const TEST_GLOSSARY_TERM_URN = "urn:li:glossaryTerm:CypressNode.CypressTerm";
const TEST_DOMAIN_NAME = "Testing";
const TEST_RELATED_TERM_NAME = "RelatedCypressTerm";

describe("summary tab - glossary term", () => {
  beforeEach(() => {
    utils.setThemeV2AndSummaryTabFlags(true);
    cy.login();
    cy.goToGlossaryTerm(TEST_GLOSSARY_TERM_URN);
    utils.goToSummaryTab();
  });

  it("glossary term - header section", () => {
    utils.testPropertiesSection([
      { name: "Created", type: "CREATED" },
      { name: "Owners", type: "OWNERS", dataTestId: `owner-${TEST_USER_URN}` },
      { name: "Domain", type: "DOMAIN", value: TEST_DOMAIN_NAME },
    ]);

    utils.ensureAboutSectionIsVisible();

    utils.testTemplateSection([
      {
        type: "assets",
        name: "Assets",
        value: TEST_DOMAIN_NAME,
      },
      {
        type: "related-terms",
        name: "Related Terms",
        value: TEST_RELATED_TERM_NAME,
      },
    ]);
  });
});
